#include "udpServer.hpp"

#include <memory>
#include <cstdio>

using namespace Server;

//
static void Usage(void *proc)
{
    std::cerr << "\nUsage:\n\t" << proc << "serverport\n\n";
}

// ./udpServer serverport
int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        exit(USAGE_ERROR);
    }

    uint16_t serverport = atoi(argv[1]);
    std::unique_ptr<udpServer> user(new udpServer(serverport));
    user->initServer();
    user->start();

    return 0;
}
